home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7815 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: newshost.lanl.gov!tanmoy
  2. From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: What is &Variable (declared as: char Var
  5. Date: 28 Feb 1996 06:51:00 GMT
  6. Organization: Los Alamos National Laboratory
  7. Message-ID: <TANMOY.96Feb27235100@qcd.lanl.gov>
  8. References: <13b_9602272020@amphigory.com>
  9. NNTP-Posting-Host: qcd.lanl.gov
  10. Mime-Version: 1.0
  11. Content-Type: text
  12. In-reply-to: Pazuzu@amphigory.com's message of 27 Feb 96 20:16:46
  13.  
  14. In article <13b_9602272020@amphigory.com>
  15. Pazuzu@amphigory.com (Pazuzu) writes:
  16.  
  17.  
  18. P: >    char myarray[10];
  19. <snip>
  20. P: myarray may not be a pointer (actually, it IS, but for the sake of
  21. argument...) 
  22.  
  23. This statement is wrong, read the FAQ.  (Sorry, I am tired of
  24. explaining this already ... look at my other posts in this thread.)
  25.  
  26. P: but EVERYTHING, EVERYTHING, EVERYTHING has a memory address (otheriwise, it
  27. P: ain't in memory!), and &<identifier> gives you its address.  myarray IS a
  28. P: pointer. All arrays are pointers.
  29.  
  30. The last statement is completely incorrect. The emphasized EVERYTHING
  31. ought to be qualified: (i+j) never has an address, neither does k
  32. after `register int k'
  33.  
  34. <snip>
  35. P: Yes, you can pass it.  here:
  36. P: 
  37. P: void func1(char *blort) {
  38. P:     printf("%s", blort);
  39. P: }
  40. P: 
  41. P: void func2(void) {
  42. P:     char astring[81];
  43. P:     strcpy(astring, "this is a test...");
  44. P:     func1(&astring);
  45. P: }
  46.  
  47. A C compiler which compiles this without diagnostic is not a
  48. conformant C compiler: the code as written is invalid C.
  49.  
  50. Cheers
  51. Tanmoy
  52. --
  53. tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
  54. Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
  55. Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
  56. <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
  57. internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
  58. fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
  59.